<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <my-com>
      <header slot="header">头部</header>
      <footer slot="footer">底部</footer>
    </my-com>
  </div>
</body>
<script src="lib/vue.js"></script>
<template id="com">
  <div>
    <slot name="header"></slot>
    <h1>插槽</h1>
    <slot name="footer"></slot>
  </div>
</template>
<script>
  const Com = {
    template: '#com'
  }
  new Vue({
    el: '#app',
    components: {
      'my-com': Com
    }
  })
</script>
</html>